/*    */ package com.zimbra.cs.service.account;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AccountConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.util.StringUtil;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.Server;
/*    */ import com.zimbra.cs.util.BuildInfo;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetVersionInfo
/*    */   extends AccountDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 34 */     if (!Provisioning.getInstance().getLocalServer().getBooleanAttr("zimbraSoapExposeVersion", false)) {
/* 35 */       throw ServiceException.PERM_DENIED("Version info is not available.");
/*    */     }
/* 37 */     ZimbraSoapContext lc = getZimbraSoapContext(context);
/*    */     
/* 39 */     Element response = lc.createElement(AccountConstants.GET_VERSION_INFO_RESPONSE);
/* 40 */     Element infoEl = response.addElement("info");
/*    */     
/* 42 */     String fullVersionInfo = BuildInfo.VERSION;
/* 43 */     if (!StringUtil.isNullOrEmpty(BuildInfo.TYPE)) {
/* 44 */       fullVersionInfo = fullVersionInfo + "." + BuildInfo.TYPE;
/*    */     }
/* 46 */     infoEl.addAttribute("version", fullVersionInfo);
/* 47 */     infoEl.addAttribute("release", BuildInfo.RELEASE);
/* 48 */     infoEl.addAttribute("buildDate", BuildInfo.DATE);
/* 49 */     infoEl.addAttribute("host", BuildInfo.HOST);
/* 50 */     return response;
/*    */   }
/*    */   
/*    */   public boolean needsAdminAuth(Map<String, Object> context) {
/* 54 */     return false;
/*    */   }
/*    */   
/*    */   public boolean needsAuth(Map<String, Object> context) {
/* 58 */     return false;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/account/GetVersionInfo.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */